From: Keir Fraser Date: Fri, 5 Jun 2009 08:26:39 +0000 (+0100) Subject: VT-d: remove useless variables X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13794 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ab6167c090dc2072672db582cff00685d58817dc;p=xen.git VT-d: remove useless variables This patch removes global variable "vtd_enabled", which is redundant. "iommu_enabled" is enough. And also removes useless global variables qi_ctrl and ir_ctrl, which are not used at all. Signed-off-by: Weidong Han --- diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c index 1587df385a..2de803d6d0 100644 --- a/xen/arch/x86/msi.c +++ b/xen/arch/x86/msi.c @@ -191,7 +191,7 @@ static void read_msi_msg(struct msi_desc *entry, struct msi_msg *msg) BUG(); } - if ( vtd_enabled ) + if ( iommu_enabled ) msi_msg_read_remap_rte(entry, msg); } diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c index 903e48d320..68881bc121 100644 --- a/xen/drivers/passthrough/vtd/dmar.c +++ b/xen/drivers/passthrough/vtd/dmar.c @@ -32,8 +32,6 @@ #include "dmar.h" #include "iommu.h" -int vtd_enabled = 1; - #undef PREFIX #define PREFIX VTDPREFIX "ACPI DMAR:" #define DEBUG @@ -561,6 +559,6 @@ int acpi_dmar_init(void) panic("acpi_dmar_init: acpi_dmar_init failed," " crash Xen for security purpose!\n"); - vtd_enabled = 0; + iommu_enabled = 0; return -ENODEV; } diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h index 0a20d34ac8..dadd5517f1 100644 --- a/xen/drivers/passthrough/vtd/extern.h +++ b/xen/drivers/passthrough/vtd/extern.h @@ -25,8 +25,6 @@ extern int qinval_enabled; extern int ats_enabled; -extern struct qi_ctrl *qi_ctrl; -extern struct ir_ctrl *ir_ctrl; void print_iommu_regs(struct acpi_drhd_unit *drhd); void print_vtd_entries(struct iommu *iommu, int bus, int devfn, u64 gmfn); diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index 4826a1ae45..50e801fe69 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1790,7 +1790,7 @@ int intel_vtd_setup(void) struct acpi_drhd_unit *drhd; struct iommu *iommu; - if ( !vtd_enabled ) + if ( !iommu_enabled ) return -ENODEV; platform_quirks(); @@ -1859,7 +1859,7 @@ int intel_vtd_setup(void) error: for_each_drhd_unit ( drhd ) iommu_free(drhd); - vtd_enabled = 0; + iommu_enabled = 0; iommu_snoop = 0; iommu_passthrough = 0; iommu_qinval = 0; @@ -1955,7 +1955,7 @@ void iommu_suspend(void) struct iommu *iommu; u32 i; - if ( !vtd_enabled ) + if ( !iommu_enabled ) return; iommu_flush_all(); @@ -1991,7 +1991,7 @@ void iommu_resume(void) struct iommu_flush *flush; u32 i; - if ( !vtd_enabled ) + if ( !iommu_enabled ) return; /* Re-initialize the register-based flush functions. diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c index c720030c0a..9854d14671 100644 --- a/xen/drivers/passthrough/vtd/utils.c +++ b/xen/drivers/passthrough/vtd/utils.c @@ -260,7 +260,7 @@ void dump_iommu_info(unsigned char key) } /* Dump the I/O xAPIC redirection table(s). */ - if ( vtd_enabled ) + if ( iommu_enabled ) { int apic, reg; union IO_APIC_reg_01 reg_01; diff --git a/xen/drivers/passthrough/vtd/x86/vtd.c b/xen/drivers/passthrough/vtd/x86/vtd.c index c41e38a3f3..7c2c80134d 100644 --- a/xen/drivers/passthrough/vtd/x86/vtd.c +++ b/xen/drivers/passthrough/vtd/x86/vtd.c @@ -117,7 +117,7 @@ void hvm_dpci_isairq_eoi(struct domain *d, unsigned int isairq) int i; ASSERT(isairq < NR_ISAIRQS); - if ( !vtd_enabled) + if ( !iommu_enabled) return; spin_lock(&d->event_lock); diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h index a47e863e1e..609d036979 100644 --- a/xen/include/xen/iommu.h +++ b/xen/include/xen/iommu.h @@ -26,7 +26,6 @@ #include #include -extern int vtd_enabled; extern int iommu_enabled; extern int iommu_pv_enabled; extern int force_iommu;